約 3,729,206 件
https://w.atwiki.jp/earthquakeinfo_en/pages/40.html
Train Status in the Tokyo area (Last updated June 28 2013)JR LinesJR East Narita Express to Narita Airport JR East Rapid Airport Narita to Narita Airport JR East Kanto area (Tokyo and around Tokyo) JR Central (Shizuoka) Non-JR Lines Tokyo area (Last updated June 28 2013)Keisei (Skyliner to Narita Airport) Tokyo Haneda Monorail Keikyu (Haneda Airport) Seibu Keio Odakyu Tokyu and Minatomirai TobuTobu Isesaki Line, Nikko Line, Noda Line Tobu Tojo Line Tokyo MetroCongestion due to anti-nuclear power protests Toei Subway Yurikamome Yokohama Subway Sagami Railway (Sotetsu) Tsukuba Express Tama Monorail Tokyo area foot links [部分編集] Train Status in the Tokyo area (Last updated June 28 2013) Important Train schedules are subject to abrupt changes. Though we try hard to provide details on railroad operations, information here is not updated in real-time. Temporary (additional) service curtailments may be imposed due to power shortages and safety reasons. Fortunately they have not happened since April 2011; it seems the power supply has stabilized. As of May 30 2013 almost all Tokyo area lines are operating on normal schedules. Standard timetables changed in March 2012 on most lines again in March 2013. Tokyo Electric Power Company (TEPCO) cannot turn on nuclear reactors until the cause of the Fukushima Daiichi accident are fully understood and preventive measures implemented. The company is not likely to regain public confidence soon. Electricity demand rises during summer, but the rail operators got through the Summer 2012 season without service curtailments electricity saving measures went no more beyond dimming lights, adjusting air conditioner settings and such. Sources official websites of railway companies. Other informative services NAVITIME TRAIN INFORMATION NAVITIME offers well-updated train information. NAVITIME Train Information service available in English, Chinese and Spanish(Espanol). JORUDAN TRAFFIC INFORMATION Jorudan offers automated timetable search facilities. JORUDAN Traffic Information service available in English and Chinese. They say that the special timetables of many operators are implemented in their route finder. HYPERDIA Automated path finder. You enter the start and end points and desired departure or arrival time. Not accurate when an operator is running on a modified timetable - which is not likely to happen. Hyperdia English, Chinese and Japanese. Other online timetables and internet path finders Article on these services, written before the earthquake Japan Train Timetable from japan-guide.com JR Lines [部分編集] JR East Narita Express to Narita Airport Updated 9 53 March 5 2013 JR East timetables will change on March 16 2013. Serivice Section Time Tokyo-Narita Aiport Status Ltd. Narita Express Tokyo - Narita Airport 60 minutes Normal timetable from September 3 2011. Rapid Airport Narita Tokyo - Narita Airport 90-100 minutes All runs in operation. Hourly service. Timetable EN http //jreast-shinkansen-reservation.eki-net.com/pc/english/common/timetable/index.html Notices EN http //www.jreast.co.jp/e/index.html Official Narita Express page EN http //www.jreast.co.jp/e/nex/ ZN http //www.jreast.co.jp/tc/index.html KR http //www.jreast.co.jp/kr/index.html For information consult JR East s global information center EN http //www.jreast.co.jp/e/customer_support/information_center.html or JR East Infoline (phone) EN http //www.jreast.co.jp/e/customer_support/infoline.html JR East Rapid Airport Narita to Narita Airport Updated 5 35 July 29 2011 All Airport Narita runs are in operation. Rapid Airport Narita is a commuter-type train. No extra fare unless you use the Green Car. It departs hourly from the Sobu Underground platforms of Tokyo Terminal. Follow the Narita Express (N Ex) markers. Important Airport Narita does not come to Ikebukuro, Shinjuku and Shibuya. Departures from "Narita Express" platforms at these stations do not go toward the airport unless they are actually Narita Express. From Shinjuku it is easier to take the yellow train and transfer to Airport Narita at Kinshicho, a smaller station than Tokyo Terminal. If in a hurry take the orange train and transfer to the yellow train at Ochanomizu. From other stations take the Yamanote Line to Shinagawa or Tokyo. Airport Narita runs along the navy blue line #2 on this map EN http //www.jreast.co.jp/e/info/map_a4ol.pdf For timetable consult Hyperdia. (Works because Airport Narita is running as normal) Narita Airport Station timetable JP http //www.jreast-timetable.jp/1108/timetable/tt1130/1130010.html (weekday) JP http //www.jreast-timetable.jp/1108/timetable/tt1130/1130011.html (weekend holiday) Airport Narita in blue. Narita Express in red. JR East Kanto area (Tokyo and around Tokyo) Updated 9 55 March 5 2013 JR East timetables will change on March 16 2013. Services will improve on many sections. EN http //www.jreast.co.jp/e/index.html EN http //traininfo.jreast.co.jp/train_info/e/kanto.aspx Map http //www.jreast.co.jp/e/info/map_a4ol.pdf JP http //www.jreast.co.jp/ Line Section Status Joban Rapid and long distance Ueno - Mito - Hitachi - Iwaki Normal timetable from July 1 2011. No limited express service north of Iwaki. Official timetables in English EN http //jreast-shinkansen-reservation.eki-net.com/pc/english/common/timetable/index.html For details consult the JR East global information center EN http //www.jreast.co.jp/e/customer_support/information_center.html or JR East Infoline (phone) EN http //www.jreast.co.jp/e/customer_support/infoline.html [部分編集] JR Central (Shizuoka) Updated 9 53 March 5 2013 EN http //english.jr-central.co.jp/index.html JP http //jr-central.co.jp/ Line Section Status Tokaido Atami - Fuji Commuter trains normal. Odoriko Ltd. normal from July 2011. Tokaido Fuji - Shizuoka - Hamamatsu - Nagoya - Maibara Normal. Minobu Fuji - Kofu Normal. Recovered from damage by typhoon March 2012. Gotemba Numazu - Gotemba - Kouzu Normal. All Asagiri runs in service. See also Odakyu for Asagiri services. Asagiri services between Gotemba and Numazu ended March 16 2012. The number of runs between Shinjuku and Gotemba was reduced from 4 each way to 3. [部分編集] Non-JR Lines Tokyo area (Last updated June 28 2013) [部分編集] Keisei (Skyliner to Narita Airport) Updated 5 47 October 11 2012 Skyliner normal from September 10 2011. JP http //www.keisei.co.jp/ EN http //www.keisei.co.jp/keisei/tetudou/skyliner/us/index.html Schedule for September 10 2011 onward Weekday timetable for weekday, weekend timetable for weekend, both with modifications. Line/Service Section Status Skyliner Ueno - Nippori - Narita Airport Normal Morningliner Normal Eveningliner Normal Cityliner Ueno - Tsudanuma - Narita Only 2 runs each way per day. Most runs canceled. Cityliner Narita - Narita Airport Out of service. No service to airport. Commuter trains all Normal all hours, including through services to Subway Asakusa Line and through services to Shin-Keisei. Above changes are still in effect as of October 2012. Skyliner timetable EN http //www.keisei.co.jp/keisei/tetudou/skyliner/us/index.html JP http //www.keisei.co.jp/keisei/tetudou/time_ex/pdf/sky/skyliner.pdf Timetables by station (all trains) JP http //www.keisei.co.jp/keisei/tetudou/time_ex/time_ex.html Keisei timetables will change on October 21 2012. An early morning Skyliner run arriving at Narita Airport 6 42AM will be added. The number of inbound Skyliner runs will increase during the afternoon. The Access Express will run faster by about 10 minutes. (No extra charge for this train.) Cityliner will decrease to one run per day each way. (No service to airport.) Details in Japanese JP http //www.keisei.co.jp/keisei/kouhou/news/120919_02.pdf New timetable in Japanese JP http //www.keisei.co.jp/keisei/kouhou/news/120921_03.pdf [部分編集] Tokyo Haneda Monorail Updated 15 56 September 11 2011 Normal from September 10 2011 EN http //www.tokyo-monorail.co.jp/english/ JP http //www.tokyo-monorail.co.jp/ [部分編集] Keikyu (Haneda Airport) Updated 11 04 August 1 2012 Normal from September 23 2011. EN http //www.keikyu.co.jp/worldwide/index.html JP http //www.keikyu.co.jp/ Electricity saving measures ended September 22 2011. On September 23, a new timetable came into effect. Haneda Airport access guide and inquiries in English EN http //www.haneda-tokyo-access.com/en/ Keikyu timetables will change drastically on October 21 2012. Haneda Airport access runs will increase to 6 per hour each from Shinagawa and Yokohama. [部分編集] Seibu Updated 9 56 March 5 2013 All operations normal from September 10 2011. JP http //www.seibu-group.co.jp/railways/ Seibu timetables will change on March 16 2013. Red Arrow timetables JP http //www.seibu-group.co.jp/railways/redarrow/timetable/index.html Timetables by station JP http //www.seibu-group.co.jp/railways/railway/timetable/index.html Automated pathfinder JP http //seibu.ekitan.com/norikae/pc/N1 [部分編集] Keio Updated 9 59 March 5 2013 EN http //www.keio.co.jp/english/index.html JP http //www.keio.co.jp/train/index.html Slight reductions on the Inokashira Line were abolished with the timetable change on February 22 2013. Keio timetables changed radically February 22 (Friday) 2013. Special Express resumed operation, adding Bubai-Gawara and Kitano as stops. In other words Semi-Special Express (Jun-Tokkyuu) was nominally promoted to Special Express (Tokkyuu). A new Semi-Special Express has been installed. It stops at all stations between Kitano and Takao-Sanguchi. (This train does not go to Hachioji.) Special Express trains have come (back) to the Sagamihara Line. One run every 20 minutes most hours. Commuter Rapid (Tsuukin Kaisoku) changed name to Semi-Express (Kukan-Kyuukou). Weekday daytime frequency on the Inokashira Line improved to 8 locals and 8 express trains each way per hour. (Restored to the pre-quake level.) Details in Japanese JP http //www.keio.co.jp/news/backnumber/news_release2012/nr121105_diagram.pdf New express chart has station names in romanized alphabet and legend in English. [部分編集] Odakyu Updated 16 27 March 10 2012 Normal operations from September 12 2011. EN http //www.odakyu.jp/english/ JP http //www.odakyu.jp/ Current timetables by station JP http //www.odakyu.jp/guide/timetable/index.html Romance Car services September 10 2011 onward All regular Romance Car runs will run. Romance Car timetables JP http //www.odakyu.jp/romancecar/schedule/index.html Odakyu timetables will change significantly on March 17 2012. Asagiri will terminate at Gotemba. (No service to Numazu.) Metro Bay Resort will disappear for good. (This run started at Hon-Atsugi and went to Tokyo Metro Yurakucho Line Shin-Kiba. It was convenient for families living along Odakyu visiting Tokyo Disney Resort.) Metro Hakone services will be expanded into weekdays. (This run is convenient for tourists staying at hotels in central Tokyo.) For inquiries call their sightseeing information center EN http //www.odakyu.jp/english/center/index.html [部分編集] Tokyu and Minatomirai Updated 11 30 June 28 2013 Normal from September 23 2011. EN http //www.tokyu.co.jp/global/index.html JP http //www.tokyu.co.jp/ JP http //www.mm21railway.co.jp/ Toyoko Line timetables changed drastically on March 16 2013. Toyoko Line combined with the Subway Fukutoshin Line at Shibuya; most trains from Yokohama stop at the underground Fukutoshin Line platforms and continue to Shinjuku-Sanchome and Ikebukuro. The new platforms are far from JR Yamanote Line, Subway Ginza Line and Keio Inokashira Line platforms. See an extra 10 minutes for transfer even if you were familiar with the prior station layout. Avoid transfers at Tokyu Shibuya during rush hours. Congestion is severe on the Den en-toshi Line Platform (also underground.) You don t want to be deep underground with the crowd when the next major earthquake hits. Slight changes will be in effect on the Tokyu Tamagawa Line and the Ikegami Line July - September 2013. Weekday morning only. (7AM -9AM) JP http //www.tokyu.co.jp/contents_index/guide/pdf/130613.pdf [部分編集] Tobu Tobu Isesaki Line, Nikko Line, Noda Line Updated 10 03 March 5 2013 Standard timetable will change March 16 2013 JP http //www.tobu.co.jp/ EN http //www.tobu.co.jp/foreign/ All sections open all hours. Operations March 17 2012 onward Narihirabashi Station changed name to "Tokyo Sky Tree". All southbound and a handful of northbound limited express runs stop. However, faster commuter-type trains continue to skip the station. A direct Nikko to Aizu-Wakamatsu service is now available Northbound Tobu Nikko 11 35 Aizu Wakamatsu 14 08 Southbound Aizu Wakamatsu 8 00 Tobu Nikko 10 56 Operates daily. If you need information on rapid/express stops etc. try Wikipedia Tobu Railway (English). For inquiries in English contact their tourist service center EN http //www.tobu.co.jp/foreign/contact.html Tobu Tojo Line Updated 10 05 March 5 2013 Normal from September 10 2011. Standard timetable and express patterns will change March 16 2013. A new train type "Rapid" (Kaisoku) will appear. Note that on Tobu, Rapid is above Express. No extra charge for the new Rapid train. [部分編集] Tokyo Metro Updated 11 11 July 10 2012 Normal from September 10 2011. No reductions Summer 2012. EN http //www.tokyometro.jp/en/index.html JP http //www.tokyometro.jp/ Congestion due to anti-nuclear power protests Updated 9 18 March 19 2013 Civilian protests against the use of nuclear are held in the political center of Tokyo between 6PM-8PM on Fridays. Organizers claim that 150,000 - 200,000 participated in demonstrations on June 29 and July 6 2012. Asahi Shimbun on March 16 2013 reports that the number has declined to the thousands. EN http //ajw.asahi.com/article/0311disaster/fukushima/AJ201303160052 In any case avoid transfers at Kokkai-Gijido-mae, including transfers involving Tameike-Sanno connected underground. They involve long walks underground; long-time Tokyo residents avoid them in any case. For alternate routes, consult someone familiar with local geography, say the hotel concierge. (In many cases you will be told to use a different subway station at the destination.) How bad the congestion can get is hard to estimate. The number of participants will fluctuate. Newspapers give disparate figures for participants in past marches some say the actual count is but one tenth of what the organizers claim. The following lines converge at the demonstration grounds Marunouchi Line, Chiyoda Line, Ginza Line. If possible, use JR East and the following subway lines, which do not go near the area Tozai Line, Asakusa Line, Mita Line, Shinjuku Line, Oedo Line. [部分編集] Toei Subway Updated 5 15 September 23 2011 All lines normal from September 23 2011. EN http //www.kotsu.metro.tokyo.jp/eng/index.html JP http //www.kotsu.metro.tokyo.jp/ [部分編集] Yurikamome Updated 7 53 September 26 2011 Normal from September 23 2011. JP http //www.yurikamome.co.jp/ Yurikamome revised its timetable on September 23. [部分編集] Yokohama Subway Updated 19 52 November 10 2011 Normal from November 1 2011. JP http //www.city.yokohama.lg.jp/koutuu/sub/ Timetables JP http //www.city.yokohama.lg.jp/koutuu/sub/kounaizu/ [部分編集] Sagami Railway (Sotetsu) Updated 5 23 September 10 2011 Normal from September 10 2011. JP http //www.sotetsu.co.jp/ Note that there is also a JR Sagami Line. [部分編集] Tsukuba Express Updated 11 10 August 1 2012 Normal from September 10 2011. EN http //www.mir.co.jp/english_guide/index.html JP http //www.mir.co.jp/ Tsukuba Express timetables will change on October 15 2012. A new fast train "commuter rapid" will appear. [部分編集] Tama Monorail Updated 5 24 September 7 2011 Normal from September 10. JP http //www.tama-monorail.co.jp/unkou.html [部分編集] Tokyo area foot links Stations within walking distance of each other, not obvious from public transportation maps. Station Station Status JR Narita Keisei Narita About 5 minutes JR KamataTokyu Kamata Keikyu Kamata About 10 minutes JR Tamachi Toei Subway Mita Just cross the street JR/Subway Akihabara Toei Shinjuku Line Iwamoto-cho About 10 minutes Seibu Ikebukuro Line Shin-Akitsu JR Musashino Line Akitsu About 5 minutes Seibu Tamagawa Line Shiraitodai Keio Main Line Musashinodai About 5 minutesMap posted both stations Keio Main Line Fuchu JR Nambu Line Musashino Line Fuchu-Honmachi About 10 minutes Seibu Tamagawa Line Koremasa JR Nambu Line Minami-Tama Cross bridge. About 15 minutes JR/Subway Nishi-Funabashi Keisei Nishi-Funa About 10 minutes(Used when Sobu Line is closed)
https://w.atwiki.jp/ce00582/pages/689.html
Function checknowork(s As Single, m As Single, n As Single, h As Single, ws, bs) As Single Dim bb As Single Dim s1 As Single Dim pp As Single Dim c1 As Single Dim u1 As Single bb = 0 For s1 = 1 To s bb = bb + bs(s1) Next bb = bb + h * n c1 = -bb / s pp = 0 If c1 0.01 Then pp = 1 If c1 0.01 Then c1 = 0.01 u1 = Log(c1) + Log(1) If u1 2 * Log(ws(s) + m * h) Then pp = 1 u1 = s * u1 If pp = 1 Then u1 = -999 checknowork = u1 End Function Function stopv(s As Single, m As Single, n As Single, nowork, v) As Single Dim m1 As Single Dim m2 As Single Dim m3 As Single Dim n1 As Single Dim n2 As Single Dim n3 As Single Dim pp As Single Dim dm As Single Dim dn As Single Dim nv As Single pp = 0 m1 = m n1 = n If m1 -5 Then pp = 1 If m1 -5 Then m1 = -4 If m1 4 Then pp = 1 If m1 4 Then m1 = 4 If n1 -25 Then pp = 1 If n1 -25 Then n1 = 9 If n1 24 Then pp = 1 If n1 24 Then n1 = 9 m2 = Int(m1) m3 = m2 + 1 n2 = Int(n1) n3 = n2 + 1 dm = (m1 - m2) * (nowork(s, m3, n2) - nowork(s, m2, n2)) dn = (n1 - n2) * (nowork(s, m2, n3) - nowork(s, m2, n2)) If nowork(s, m2, n2) -900 Then pp = 1 If nowork(s, m3, n2) -900 Then pp = 1 If nowork(s, m2, n3) -900 Then pp = 1 nv = nowork(s, m2, n2) + dm + dn If pp = 1 Then nv = -999 v1 = nearv(s, m, n, v) x = 0 If nv v1 Then x = 1 If nv = v1 Then x = 1 stopv = x End Function Function gotow(s As Single, m As Single, n As Single, h As Single, ws, u, v) As Single Dim bxs As Single Dim bx1 As Single Dim bx2 As Single Dim uxs As Single Dim wxs As Single Dim mxs As Single Dim nxs As Single Dim ux1 As Single Dim wx1 As Single Dim mx1 As Single Dim nx1 As Single Dim ux2 As Single Dim wx2 As Single Dim mx2 As Single Dim nx2 As Single Dim j As Single Dim t1 As Single Dim bxp As Single Dim t2 As Single Dim ps As Single Dim p1 As Single Dim p2 As Single j = 3 bxs = 0 uxs = nru(s, m, bxs, u) wxs = seekw(uxs) ps = 0 If wxs -900 Then ps = 1 If wxs -900 Then wxs = ws(s - 1) mxs = (wxs - ws(s - 1)) / h nxs = n - bxs vxs = uxs + nearv(s - 1, mxs, nxs, v) If ps = 1 Then vxs = -999 bxp = 888 t2 = 0 Do Until t2 10 t1 = 0 Do Until t1 100 bx1 = bxs + j ux1 = nru(s, m, bx1, u) wx1 = seekw(ux1) p1 = 0 If wx1 -900 Then p1 = 1 If wx1 -900 Then wx1 = ws(s - 1) mx1 = (wx1 - ws(s - 1)) / h nx1 = n - bx1 vx1 = ux1 + nearv(s - 1, mx1, nx1, v) If p1 = 1 Then vx1 = -999 bx2 = bxs - j ux2 = nru(s, m, bx2, u) wx2 = seekw(ux2) p2 = 0 If wx2 -900 Then p2 = 1 If wx2 -900 Then wx2 = ws(s - 1) mx2 = (wx2 - ws(s - 1)) / h nx2 = n - bx2 vx2 = ux2 + nearv(s - 1, mx2, nx2, v) If p2 = 1 Then vx2 = -999 If vx1 vxs Then bxs = bx1 If vx1 vxs Then vxs = vx1 If vx2 vxs Then bxs = bx2 If vx2 vxs Then vxs = vx2 If (bxp - bxs) ^ 2 10 ^ (-9) Then t1 = 1000 bxp = bxs t1 = t1 + 1 Loop t2 = t2 + 1 j = j / 2 Loop uxs = nru(s, m, bxs, u) wxs = seekw(uxs) mxs = (wxs - ws(s - 1)) / h gotow = mxs End Function Function gotob(s As Single, m As Single, n As Single, h As Single, ws, u, v) As Single Dim bxs As Single Dim bx1 As Single Dim bx2 As Single Dim uxs As Single Dim wxs As Single Dim mxs As Single Dim nxs As Single Dim ux1 As Single Dim wx1 As Single Dim mx1 As Single Dim nx1 As Single Dim ux2 As Single Dim wx2 As Single Dim mx2 As Single Dim nx2 As Single Dim j As Single Dim t1 As Single Dim bxp As Single Dim t2 As Single Dim ps As Single Dim p1 As Single Dim p2 As Single j = 3 bxs = 0 uxs = nru(s, m, bxs, u) wxs = seekw(uxs) ps = 0 If wxs -900 Then ps = 1 If wxs -900 Then wxs = ws(s - 1) mxs = (wxs - ws(s - 1)) / h nxs = n - bxs vxs = uxs + nearv(s - 1, mxs, nxs, v) If ps = 1 Then vxs = -999 bxp = 888 t2 = 0 Do Until t2 10 t1 = 0 Do Until t1 100 bx1 = bxs + j ux1 = nru(s, m, bx1, u) wx1 = seekw(ux1) p1 = 0 If wx1 -900 Then p1 = 1 If wx1 -900 Then wx1 = ws(s - 1) mx1 = (wx1 - ws(s - 1)) / h nx1 = n - bx1 vx1 = ux1 + nearv(s - 1, mx1, nx1, v) If p1 = 1 Then vx1 = -999 bx2 = bxs - j ux2 = nru(s, m, bx2, u) wx2 = seekw(ux2) p2 = 0 If wx2 -900 Then p2 = 1 If wx2 -900 Then wx2 = ws(s - 1) mx2 = (wx2 - ws(s - 1)) / h nx2 = n - bx2 vx2 = ux2 + nearv(s - 1, mx2, nx2, v) If p2 = 1 Then vx2 = -999 If vx1 vxs Then bxs = bx1 If vx1 vxs Then vxs = vx1 If vx2 vxs Then bxs = bx2 If vx2 vxs Then vxs = vx2 If (bxp - bxs) ^ 2 10 ^ (-9) Then t1 = 1000 bxp = bxs t1 = t1 + 1 Loop t2 = t2 + 1 j = j / 2 Loop gotob = n - bxs End Function Function nru(s As Single, m As Single, n As Single, u) As Single Dim n1 As Single Dim n2 As Single Dim n3 As Single Dim m1 As Single Dim m2 As Single Dim m3 As Single Dim pp As Single Dim dn As Single Dim nu As Single pp = 0 n1 = n m1 = m If m1 -5 Then pp = 1 If m1 -5 Then m1 = -5 If m1 4 Then pp = 1 If m1 4 Then m1 = 4 If n1 -5 Then pp = 1 If n1 -5 Then n1 = -5 If n1 4 Then pp = 1 If n1 4 Then n1 = 4 n2 = Int(n1) n3 = n2 + 1 dn = (n1 - n2) * (u(s, m2, n3) - u(s, m2, n2)) dm = (m1 - m2) * (u(s, m3, n2) - u(s, m2, n2)) If u(s, m2, n2) -900 Then pp = 1 If u(s, m2, n3) -900 Then pp = 1 If u(s, m3, n2) -900 Then pp = 1 nu = u(s, m, n2) + dn + dm If pp = 1 Then nu = -999 nru = nu End Function Function seekstartu(th, bp As Single) As Single Dim ls As Single Dim cs As Single Dim us As Single Dim ys As Single Dim ws As Single Dim l1 As Single Dim c1 As Single Dim u1 As Single Dim l2 As Single Dim y2 As Single Dim y1 As Single Dim c2 As Single Dim u2 As Single Dim h As Single Dim lp As Single Dim t1 As Single Dim t2 As Single Dim e As Single e = 10 ^ (-5) h = 0.1 ls = 0.5 ys = th(100) * ls cs = ys - bp us = Log(cs) + Log(1 - ls) t2 = 0 Do Until t2 10 t1 = 0 Do Until t1 100 l1 = ls + h c1 = th(100) * l1 - bp u1 = Log(c1) + Log(1 - l1) l2 = ls - h If l2 0.01 Then l2 = ls c2 = th(100) * l2 - bp u2 = Log(c2) + Log(1 - l2) If u1 us Then ls = l1 If u1 us Then us = u1 If u2 us Then ls = l2 If u2 us Then us = u2 If (lp - ls) ^ 2 e Then t1 = 1000 lp = ls t1 = t1 + 1 Loop h = h / 2 t2 = t2 + 1 Loop seekstartu = us End Function Function seeknowork(s As Single, m As Single, n As Single, h As Single, ws, bs) As Single Dim bb As Single Dim s1 As Single Dim pp As Single Dim c1 As Single Dim u1 As Single bb = 0 For s1 = 1 To s bb = bb + bs(s1) Next bb = bb + h * n c1 = -bb / s pp = 0 If c1 0.01 Then pp = 1 If c1 0.01 Then c1 = 0.01 u1 = Log(c1) + Log(1) If u1 2 * Log(ws(s) + m * h) Then pp = 1 u1 = s * u1 If pp = 1 Then u1 = -999 seeknowork = u1 End Function Function seekv(s As Single, m As Single, n As Single, h As Single, ws, u, v) As Single Dim bxs As Single Dim bx1 As Single Dim bx2 As Single Dim uxs As Single Dim wxs As Single Dim mxs As Single Dim nxs As Single Dim ux1 As Single Dim wx1 As Single Dim mx1 As Single Dim nx1 As Single Dim ux2 As Single Dim wx2 As Single Dim mx2 As Single Dim nx2 As Single Dim j As Single Dim t1 As Single Dim bxp As Single Dim t2 As Single Dim ps As Single Dim p1 As Single Dim p2 As Single j = 3 bxs = 0 uxs = nearu(s, m, bxs, u) wxs = seekw(uxs) ps = 0 If wxs -900 Then ps = 1 If wxs -900 Then wxs = ws(s - 1) mxs = (wxs - ws(s - 1)) / h nxs = n - bxs vxs = uxs + nearv(s - 1, mxs, nxs, v) If ps = 1 Then vxs = -999 bxp = 888 t2 = 0 Do Until t2 10 t1 = 0 Do Until t1 100 bx1 = bxs + j ux1 = nearu(s, m, bx1, u) wx1 = seekw(ux1) p1 = 0 If wx1 -900 Then p1 = 1 If wx1 -900 Then wx1 = ws(s - 1) mx1 = (wx1 - ws(s - 1)) / h nx1 = n - bx1 vx1 = ux1 + nearv(s - 1, mx1, nx1, v) If p1 = 1 Then vx1 = -999 bx2 = bxs - j ux2 = nearu(s, m, bx2, u) wx2 = seekw(ux2) p2 = 0 If wx2 -900 Then p2 = 1 If wx2 -900 Then wx2 = ws(s - 1) mx2 = (wx2 - ws(s - 1)) / h nx2 = n - bx2 vx2 = ux2 + nearv(s - 1, mx2, nx2, v) If p2 = 1 Then vx2 = -999 If vx1 vxs Then bxs = bx1 If vx1 vxs Then vxs = vx1 If vx2 vxs Then bxs = bx2 If vx2 vxs Then vxs = vx2 If (bxp - bxs) ^ 2 10 ^ (-9) Then t1 = 1000 bxp = bxs t1 = t1 + 1 Loop t2 = t2 + 1 j = j / 2 Loop seekv = vxs End Function Function nearu(s As Single, m As Single, n As Single, u) As Single Dim n1 As Single Dim n2 As Single Dim n3 As Single Dim pp As Single Dim dn As Single Dim nu As Single pp = 0 n1 = n If n1 -5 Then pp = 1 If n1 -5 Then n1 = -5 If n1 4 Then pp = 1 If n1 4 Then n1 = 4 n2 = Int(n1) n3 = n2 + 1 dn = (n1 - n2) * (u(s, m, n3) - u(s, m, n2)) If u(s, m, n2) -900 Then pp = 1 If u(s, m, n3) -900 Then pp = 1 nu = u(s, m, n2) + dn If pp = 1 Then nu = -999 nearu = nu End Function Function nearv(s As Single, mx As Single, nx As Single, v) As Single Dim m1 As Single Dim m2 As Single Dim m3 As Single Dim n1 As Single Dim n2 As Single Dim n3 As Single Dim pp As Single Dim dm As Single Dim dn As Single Dim nv As Single pp = 0 m1 = mx n1 = nx If m1 -5 Then pp = 1 If m1 -5 Then m1 = -4 If m1 4 Then pp = 1 If m1 4 Then m1 = 4 If n1 -25 Then pp = 1 If n1 -25 Then n1 = 9 If n1 24 Then pp = 1 If n1 24 Then n1 = 9 m2 = Int(m1) m3 = m2 + 1 n2 = Int(n1) n3 = n2 + 1 dm = (m1 - m2) * (v(s, m3, n2) - v(s, m2, n2)) dn = (n1 - n2) * (v(s, m2, n3) - v(s, m2, n2)) If v(s, m2, n2) -900 Then pp = 1 If v(s, m3, n2) -900 Then pp = 1 If v(s, m2, n3) -900 Then pp = 1 nv = v(s, m2, n2) + dm + dn If pp = 1 Then nv = -999 nearv = nv End Function Function seeku(s As Single, th, wp As Single, bp As Single) As Single Dim ls As Single Dim cs As Single Dim us As Single Dim ys As Single Dim ws As Single Dim l1 As Single Dim c1 As Single Dim u1 As Single Dim l2 As Single Dim y2 As Single Dim y1 As Single Dim c2 As Single Dim u2 As Single Dim h As Single Dim lp As Single Dim t1 As Single Dim t2 As Single Dim e As Single e = 10 ^ (-5) h = 0.1 ls = (bp + 0.01) / th(s) If ls 0.01 Then ls = 0.01 ys = th(s) * ls cs = ys - bp us = Log(cs) + Log(1 - ls) ws = Log(cs) + Log(1 - ys / th(s + 1)) If ws wp Then us = -999 t2 = 0 Do Until t2 10 t1 = 0 Do Until t1 100 l1 = ls + h If l1 0.99 Then l1 = ls c1 = th(s) * l1 - bp y1 = th(s) * l1 u1 = Log(c1) + Log(1 - l1) w1 = Log(c1) + Log(1 - y1 / th(s + 1)) If w1 wp Then u1 = -999 l2 = ls - h If l2 0.01 Then l2 = ls c2 = th(s) * l2 - bp If c2 0.01 Then l2 = ls c2 = th(s) * l2 - bp y2 = th(s) * l2 u2 = Log(c2) + Log(1 - l2) w2 = Log(c2) + Log(1 - y2 / th(s + 1)) If w2 wp Then u2 = -999 If u1 us Then ls = l1 If u1 us Then us = u1 If u2 us Then ls = l2 If u2 us Then us = u2 If (lp - ls) ^ 2 e Then t1 = 1000 lp = ls t1 = t1 + 1 Loop h = h / 2 t2 = t2 + 1 Loop seeku = us End Function Function seekw(wp As Single) As Single Dim x1 As Single Dim x2 As Single Dim x3 As Single Dim w1 As Single Dim w2 As Single Dim t As Single Dim pp As Single pp = 0 If wp 2 * Log(0.1) Then pp = 1 If wp 2 * Log(1) Then pp = 1 x1 = 0.3 x2 = 0.7 t = 0 If pp = 1 Then t = 1000 Do Until t 100 w1 = 2 * Log(x1) w2 = 2 * Log(x2) x3 = x2 + (wp - w2) * (x2 - x1) / (w2 - w1) x1 = x2 x2 = x3 If (wp - w2) ^ 2 10 ^ (-5) Then t = 1000 t = t + 1 Loop If pp = 1 Then x2 = -999 seekw = x2 End Function Function lx(s As Single, th, tl As Single, tr As Single) As Single Dim ls As Single ls = ((1 - tl) * th(s) - tr) / (2 * (1 - tl) * th(s)) If ls 0 Then ls = 0 lx = ls End Function Function cx(s As Single, th, tl As Single, tr As Single) As Single Dim ls As Single ls = ((1 - tl) * th(s) - tr) / (2 * (1 - tl) * th(s)) If ls 0 Then ls = 0 cx = (1 - tl) * th(s) * ls + tr End Function Function tls(th) As Single Dim maxw As Single Dim tl As Single Dim tr As Single Dim tp As Single Dim w1 As Single Dim n As Single maxw = -999 For n = 1 To 400 tl = 0.001 * n tr = trs(th, tl) w1 = wel(th, tl, tr) If w1 maxw Then tp = tl If w1 maxw Then maxw = w1 Next tls = tp End Function Function trs(th, tl As Single) As Single Dim tr1 As Single Dim tr2 As Single Dim tr3 As Single Dim b1 As Single Dim b2 As Single Dim t As Single tr1 = 0 tr2 = 0.1 t = 0 Do Until t 100 b1 = bud(th, tl, tr1) b2 = bud(th, tl, tr2) tr3 = tr2 - b2 * (tr2 - tr1) / (b2 - b1) tr1 = tr2 tr2 = tr3 If (tr1 - tr2) ^ 2 10 ^ (-5) Then t = 1000 t = t + 1 Loop trs = tr2 End Function Function wel(th, tl As Single, tr As Single) As Single Dim w1 As Single Dim s As Single Dim ls As Single Dim cs As Single w1 = 0 For s = 1 To 100 ls = lx(s, th, tl, tr) If ls 0 Then ls = 0 cs = cx(s, th, tl, tr) w1 = w1 + Log(cs) + Log(1 - ls) Next wel = w1 End Function Function bud(th, tl As Single, tr As Single) As Single Dim w1 As Single Dim s As Single Dim ls As Single Dim cs As Single Dim ys As Single ys = 0 cs = 0 For s = 1 To 100 ls = lx(s, th, tl, tr) If ls 0 Then ls = 0 ys = ys + th(s) * ls cs = cs + cx(s, th, tl, tr) Next bud = ys - cs End Function Private Sub Command1_Click() Dim th(1 To 100) As Single Dim s As Single Dim m As Single Dim n As Single Dim tl As Single Dim tr As Single Dim bs(1 To 100) As Single Dim ws(1 To 99) As Single Dim startu(-50 To 50) As Single Dim u(1 To 99, -5 To 5, -5 To 5) As Single Dim v(1 To 99, -5 To 5, -25 To 25) As Single Dim nowork(1 To 99, -5 To 5, -25 To 25) As Single Dim w1 As Single Dim wp As Single Dim bp As Single Dim h As Single Dim bb As Single Dim s1 As Single For s = 1 To 100 th(s) = 0.02 * s Next tl = tls(th) tr = trs(th, tl) Debug.Print tl, tr For s = 1 To 100 bs(s) = th(s) * lx(s, th, tl, tr) - cx(s, th, tl, tr) Next For s = 1 To 99 w1 = Log(cx(s, th, tl, tr)) + Log(1 - th(s) * lx(s, th, tl, tr) / th(s + 1)) ws(s) = seekw(w1) Next h = 10 ^ (-2) For s = 1 To 99 For m = -5 To 5 For n = -5 To 5 wp = 2 * Log(ws(s) + h * m) bp = bs(s) + h * n u(s, m, n) = seeku(s, th, wp, bp) Next Next Next For s = 1 To 99 For m = -5 To 5 For n = -25 To 25 nowork(s, m, n) = seeknowork(s, m, n, h, ws, bs) Next Next Next For s = 1 To 99 For m = -5 To 5 For n = -25 To 25 v(s, m, n) = -999 Next Next Next s = 1 For m = -5 To 5 For n = -5 To 5 v(s, m, n) = u(s, m, n) If nowork(s, m, n) v(s, m, n) Then v(s, m, n) = nowork(s, m, n) Next Next For s = 2 To 99 For m = -5 To 5 For n = -25 To 25 v(s, m, n) = seekv(s, m, n, h, ws, u, v) If nowork(s, m, n) v(s, m, n) Then v(s, m, n) = nowork(s, m, n) Next Next Debug.Print s, v(s, 0, 0) Next For n = -50 To 50 bp = bs(100) + 0.1 * n * h startu(n) = seekstartu(th, bp) Next Dim u1 As Single Dim opb(1 To 99) As Single Dim opw(1 To 99) As Single vs = -999 For n = -50 To 50 u1 = startu(n) m1 = (seekw(u1) - ws(99)) / h m2 = Int(m1) If m2 5 Then m2 = 5 m3 = m2 + 1 If m3 = 6 Then m3 = 5 n1 = 0.1 * n n2 = Int(n1) n3 = n2 + 1 dm = (m1 - m2) * (v(99, m3, -n2) - v(99, m2, -n2)) dn = (n1 - n2) * (v(99, m2, -n3) - v(99, m2, -n2)) v1 = startu(n) + v(99, m2, -n2) + dm + dn If v1 vs Then ms = m1 If v1 vs Then ns = n1 If v1 vs Then vs = v1 Debug.Print ms, ns, vs Next Dim stoppoint As Single opw(99) = ms opb(99) = -ns s = 99 Do Until s 10 s = s - 1 opb(s) = gotob(s + 1, opw(s + 1), opb(s + 1), h, ws, u, v) opw(s) = gotow(s + 1, opw(s + 1), opb(s + 1), h, ws, u, v) Debug.Print s + 1, opw(s + 1), opb(s + 1) If stopv(s, opw(s), opb(s), nowork, v) = 0 Then stoppoint = s If stopv(s, opw(s), opb(s), nowork, v) 0 Then s = -10 Loop s = stoppoint Debug.Print checknowork(s, opw(s), opb(s), h, ws, bs) End Sub
https://w.atwiki.jp/ce00582/pages/690.html
Function seekc(s As Single, th, wp As Single, bp As Single) As Single Dim ls As Single Dim cs As Single Dim us As Single Dim ys As Single Dim ws As Single Dim l1 As Single Dim c1 As Single Dim u1 As Single Dim l2 As Single Dim y2 As Single Dim y1 As Single Dim c2 As Single Dim u2 As Single Dim h As Single Dim lp As Single Dim t1 As Single Dim t2 As Single Dim e As Single e = 10 ^ (-5) h = 0.1 ls = (bp + 0.01) / th(s) If ls 0.01 Then ls = 0.01 ys = th(s) * ls cs = ys - bp us = Log(cs) + Log(1 - ls) ws = Log(cs) + Log(1 - ys / th(s + 1)) If ws wp Then us = -999 t2 = 0 Do Until t2 10 t1 = 0 Do Until t1 100 l1 = ls + h If l1 0.99 Then l1 = ls c1 = th(s) * l1 - bp y1 = th(s) * l1 u1 = Log(c1) + Log(1 - l1) w1 = Log(c1) + Log(1 - y1 / th(s + 1)) If w1 wp Then u1 = -999 l2 = ls - h If l2 0.01 Then l2 = ls c2 = th(s) * l2 - bp If c2 0.01 Then l2 = ls c2 = th(s) * l2 - bp y2 = th(s) * l2 u2 = Log(c2) + Log(1 - l2) w2 = Log(c2) + Log(1 - y2 / th(s + 1)) If w2 wp Then u2 = -999 If u1 us Then ls = l1 If u1 us Then us = u1 If u2 us Then ls = l2 If u2 us Then us = u2 If (lp - ls) ^ 2 e Then t1 = 1000 lp = ls t1 = t1 + 1 Loop h = h / 2 t2 = t2 + 1 Loop seekc = th(s) * ls - bp End Function Function seekl(s As Single, th, wp As Single, bp As Single) As Single Dim ls As Single Dim cs As Single Dim us As Single Dim ys As Single Dim ws As Single Dim l1 As Single Dim c1 As Single Dim u1 As Single Dim l2 As Single Dim y2 As Single Dim y1 As Single Dim c2 As Single Dim u2 As Single Dim h As Single Dim lp As Single Dim t1 As Single Dim t2 As Single Dim e As Single e = 10 ^ (-5) h = 0.1 ls = (bp + 0.01) / th(s) If ls 0.01 Then ls = 0.01 ys = th(s) * ls cs = ys - bp us = Log(cs) + Log(1 - ls) ws = Log(cs) + Log(1 - ys / th(s + 1)) If ws wp Then us = -999 t2 = 0 Do Until t2 10 t1 = 0 Do Until t1 100 l1 = ls + h If l1 0.99 Then l1 = ls c1 = th(s) * l1 - bp y1 = th(s) * l1 u1 = Log(c1) + Log(1 - l1) w1 = Log(c1) + Log(1 - y1 / th(s + 1)) If w1 wp Then u1 = -999 l2 = ls - h If l2 0.01 Then l2 = ls c2 = th(s) * l2 - bp If c2 0.01 Then l2 = ls c2 = th(s) * l2 - bp y2 = th(s) * l2 u2 = Log(c2) + Log(1 - l2) w2 = Log(c2) + Log(1 - y2 / th(s + 1)) If w2 wp Then u2 = -999 If u1 us Then ls = l1 If u1 us Then us = u1 If u2 us Then ls = l2 If u2 us Then us = u2 If (lp - ls) ^ 2 e Then t1 = 1000 lp = ls t1 = t1 + 1 Loop h = h / 2 t2 = t2 + 1 Loop seekl = ls End Function Function checknowork(s As Single, m As Single, n As Single, h As Single, ws, bs) As Single Dim bb As Single Dim s1 As Single Dim pp As Single Dim c1 As Single Dim u1 As Single bb = 0 For s1 = 1 To s bb = bb + bs(s1) Next bb = bb + h * n c1 = -bb / s pp = 0 If c1 0.01 Then pp = 1 If c1 0.01 Then c1 = 0.01 u1 = Log(c1) + Log(1) If u1 2 * Log(ws(s) + m * h) Then pp = 1 u1 = s * u1 If pp = 1 Then u1 = -999 checknowork = u1 End Function Function stopv(s As Single, m As Single, n As Single, nowork, v) As Single Dim m1 As Single Dim m2 As Single Dim m3 As Single Dim n1 As Single Dim n2 As Single Dim n3 As Single Dim pp As Single Dim dm As Single Dim dn As Single Dim nv As Single pp = 0 m1 = m n1 = n If m1 -5 Then pp = 1 If m1 -5 Then m1 = -4 If m1 4 Then pp = 1 If m1 4 Then m1 = 4 If n1 -25 Then pp = 1 If n1 -25 Then n1 = 9 If n1 24 Then pp = 1 If n1 24 Then n1 = 9 m2 = Int(m1) m3 = m2 + 1 n2 = Int(n1) n3 = n2 + 1 dm = (m1 - m2) * (nowork(s, m3, n2) - nowork(s, m2, n2)) dn = (n1 - n2) * (nowork(s, m2, n3) - nowork(s, m2, n2)) If nowork(s, m2, n2) -900 Then pp = 1 If nowork(s, m3, n2) -900 Then pp = 1 If nowork(s, m2, n3) -900 Then pp = 1 nv = nowork(s, m2, n2) + dm + dn If pp = 1 Then nv = -999 v1 = nearv(s, m, n, v) x = 0 If nv v1 Then x = 1 If nv = v1 Then x = 1 stopv = x End Function Function gotow(s As Single, m As Single, n As Single, h As Single, ws, u, v) As Single Dim bxs As Single Dim bx1 As Single Dim bx2 As Single Dim uxs As Single Dim wxs As Single Dim mxs As Single Dim nxs As Single Dim ux1 As Single Dim wx1 As Single Dim mx1 As Single Dim nx1 As Single Dim ux2 As Single Dim wx2 As Single Dim mx2 As Single Dim nx2 As Single Dim j As Single Dim t1 As Single Dim bxp As Single Dim t2 As Single Dim ps As Single Dim p1 As Single Dim p2 As Single j = 3 bxs = 0 uxs = nru(s, m, bxs, u) wxs = seekw(uxs) ps = 0 If wxs -900 Then ps = 1 If wxs -900 Then wxs = ws(s - 1) mxs = (wxs - ws(s - 1)) / h nxs = n - bxs vxs = uxs + nearv(s - 1, mxs, nxs, v) If ps = 1 Then vxs = -999 bxp = 888 t2 = 0 Do Until t2 10 t1 = 0 Do Until t1 100 bx1 = bxs + j ux1 = nru(s, m, bx1, u) wx1 = seekw(ux1) p1 = 0 If wx1 -900 Then p1 = 1 If wx1 -900 Then wx1 = ws(s - 1) mx1 = (wx1 - ws(s - 1)) / h nx1 = n - bx1 vx1 = ux1 + nearv(s - 1, mx1, nx1, v) If p1 = 1 Then vx1 = -999 bx2 = bxs - j ux2 = nru(s, m, bx2, u) wx2 = seekw(ux2) p2 = 0 If wx2 -900 Then p2 = 1 If wx2 -900 Then wx2 = ws(s - 1) mx2 = (wx2 - ws(s - 1)) / h nx2 = n - bx2 vx2 = ux2 + nearv(s - 1, mx2, nx2, v) If p2 = 1 Then vx2 = -999 If vx1 vxs Then bxs = bx1 If vx1 vxs Then vxs = vx1 If vx2 vxs Then bxs = bx2 If vx2 vxs Then vxs = vx2 If (bxp - bxs) ^ 2 10 ^ (-9) Then t1 = 1000 bxp = bxs t1 = t1 + 1 Loop t2 = t2 + 1 j = j / 2 Loop uxs = nru(s, m, bxs, u) wxs = seekw(uxs) mxs = (wxs - ws(s - 1)) / h gotow = mxs End Function Function gotob(s As Single, m As Single, n As Single, h As Single, ws, u, v) As Single Dim bxs As Single Dim bx1 As Single Dim bx2 As Single Dim uxs As Single Dim wxs As Single Dim mxs As Single Dim nxs As Single Dim ux1 As Single Dim wx1 As Single Dim mx1 As Single Dim nx1 As Single Dim ux2 As Single Dim wx2 As Single Dim mx2 As Single Dim nx2 As Single Dim j As Single Dim t1 As Single Dim bxp As Single Dim t2 As Single Dim ps As Single Dim p1 As Single Dim p2 As Single j = 3 bxs = 0 uxs = nru(s, m, bxs, u) wxs = seekw(uxs) ps = 0 If wxs -900 Then ps = 1 If wxs -900 Then wxs = ws(s - 1) mxs = (wxs - ws(s - 1)) / h nxs = n - bxs vxs = uxs + nearv(s - 1, mxs, nxs, v) If ps = 1 Then vxs = -999 bxp = 888 t2 = 0 Do Until t2 10 t1 = 0 Do Until t1 100 bx1 = bxs + j ux1 = nru(s, m, bx1, u) wx1 = seekw(ux1) p1 = 0 If wx1 -900 Then p1 = 1 If wx1 -900 Then wx1 = ws(s - 1) mx1 = (wx1 - ws(s - 1)) / h nx1 = n - bx1 vx1 = ux1 + nearv(s - 1, mx1, nx1, v) If p1 = 1 Then vx1 = -999 bx2 = bxs - j ux2 = nru(s, m, bx2, u) wx2 = seekw(ux2) p2 = 0 If wx2 -900 Then p2 = 1 If wx2 -900 Then wx2 = ws(s - 1) mx2 = (wx2 - ws(s - 1)) / h nx2 = n - bx2 vx2 = ux2 + nearv(s - 1, mx2, nx2, v) If p2 = 1 Then vx2 = -999 If vx1 vxs Then bxs = bx1 If vx1 vxs Then vxs = vx1 If vx2 vxs Then bxs = bx2 If vx2 vxs Then vxs = vx2 If (bxp - bxs) ^ 2 10 ^ (-9) Then t1 = 1000 bxp = bxs t1 = t1 + 1 Loop t2 = t2 + 1 j = j / 2 Loop gotob = n - bxs End Function Function nru(s As Single, m As Single, n As Single, u) As Single Dim n1 As Single Dim n2 As Single Dim n3 As Single Dim m1 As Single Dim m2 As Single Dim m3 As Single Dim pp As Single Dim dn As Single Dim nu As Single pp = 0 n1 = n m1 = m If m1 -5 Then pp = 1 If m1 -5 Then m1 = -5 If m1 4 Then pp = 1 If m1 4 Then m1 = 4 If n1 -5 Then pp = 1 If n1 -5 Then n1 = -5 If n1 4 Then pp = 1 If n1 4 Then n1 = 4 n2 = Int(n1) n3 = n2 + 1 dn = (n1 - n2) * (u(s, m2, n3) - u(s, m2, n2)) dm = (m1 - m2) * (u(s, m3, n2) - u(s, m2, n2)) If u(s, m2, n2) -900 Then pp = 1 If u(s, m2, n3) -900 Then pp = 1 If u(s, m3, n2) -900 Then pp = 1 nu = u(s, m, n2) + dn + dm If pp = 1 Then nu = -999 nru = nu End Function Function seekstartu(th, bp As Single) As Single Dim ls As Single Dim cs As Single Dim us As Single Dim ys As Single Dim ws As Single Dim l1 As Single Dim c1 As Single Dim u1 As Single Dim l2 As Single Dim y2 As Single Dim y1 As Single Dim c2 As Single Dim u2 As Single Dim h As Single Dim lp As Single Dim t1 As Single Dim t2 As Single Dim e As Single e = 10 ^ (-5) h = 0.1 ls = 0.5 ys = th(100) * ls cs = ys - bp us = Log(cs) + Log(1 - ls) t2 = 0 Do Until t2 10 t1 = 0 Do Until t1 100 l1 = ls + h c1 = th(100) * l1 - bp u1 = Log(c1) + Log(1 - l1) l2 = ls - h If l2 0.01 Then l2 = ls c2 = th(100) * l2 - bp u2 = Log(c2) + Log(1 - l2) If u1 us Then ls = l1 If u1 us Then us = u1 If u2 us Then ls = l2 If u2 us Then us = u2 If (lp - ls) ^ 2 e Then t1 = 1000 lp = ls t1 = t1 + 1 Loop h = h / 2 t2 = t2 + 1 Loop seekstartu = us End Function Function seeknowork(s As Single, m As Single, n As Single, h As Single, ws, bs) As Single Dim bb As Single Dim s1 As Single Dim pp As Single Dim c1 As Single Dim u1 As Single bb = 0 For s1 = 1 To s bb = bb + bs(s1) Next bb = bb + h * n c1 = -bb / s pp = 0 If c1 0.01 Then pp = 1 If c1 0.01 Then c1 = 0.01 u1 = Log(c1) + Log(1) If u1 2 * Log(ws(s) + m * h) Then pp = 1 u1 = s * u1 If pp = 1 Then u1 = -999 seeknowork = u1 End Function Function seekv(s As Single, m As Single, n As Single, h As Single, ws, u, v) As Single Dim bxs As Single Dim bx1 As Single Dim bx2 As Single Dim uxs As Single Dim wxs As Single Dim mxs As Single Dim nxs As Single Dim ux1 As Single Dim wx1 As Single Dim mx1 As Single Dim nx1 As Single Dim ux2 As Single Dim wx2 As Single Dim mx2 As Single Dim nx2 As Single Dim j As Single Dim t1 As Single Dim bxp As Single Dim t2 As Single Dim ps As Single Dim p1 As Single Dim p2 As Single j = 3 bxs = 0 uxs = nearu(s, m, bxs, u) wxs = seekw(uxs) ps = 0 If wxs -900 Then ps = 1 If wxs -900 Then wxs = ws(s - 1) mxs = (wxs - ws(s - 1)) / h nxs = n - bxs vxs = uxs + nearv(s - 1, mxs, nxs, v) If ps = 1 Then vxs = -999 bxp = 888 t2 = 0 Do Until t2 10 t1 = 0 Do Until t1 100 bx1 = bxs + j ux1 = nearu(s, m, bx1, u) wx1 = seekw(ux1) p1 = 0 If wx1 -900 Then p1 = 1 If wx1 -900 Then wx1 = ws(s - 1) mx1 = (wx1 - ws(s - 1)) / h nx1 = n - bx1 vx1 = ux1 + nearv(s - 1, mx1, nx1, v) If p1 = 1 Then vx1 = -999 bx2 = bxs - j ux2 = nearu(s, m, bx2, u) wx2 = seekw(ux2) p2 = 0 If wx2 -900 Then p2 = 1 If wx2 -900 Then wx2 = ws(s - 1) mx2 = (wx2 - ws(s - 1)) / h nx2 = n - bx2 vx2 = ux2 + nearv(s - 1, mx2, nx2, v) If p2 = 1 Then vx2 = -999 If vx1 vxs Then bxs = bx1 If vx1 vxs Then vxs = vx1 If vx2 vxs Then bxs = bx2 If vx2 vxs Then vxs = vx2 If (bxp - bxs) ^ 2 10 ^ (-9) Then t1 = 1000 bxp = bxs t1 = t1 + 1 Loop t2 = t2 + 1 j = j / 2 Loop seekv = vxs End Function Function nearu(s As Single, m As Single, n As Single, u) As Single Dim n1 As Single Dim n2 As Single Dim n3 As Single Dim pp As Single Dim dn As Single Dim nu As Single pp = 0 n1 = n If n1 -5 Then pp = 1 If n1 -5 Then n1 = -5 If n1 4 Then pp = 1 If n1 4 Then n1 = 4 n2 = Int(n1) n3 = n2 + 1 dn = (n1 - n2) * (u(s, m, n3) - u(s, m, n2)) If u(s, m, n2) -900 Then pp = 1 If u(s, m, n3) -900 Then pp = 1 nu = u(s, m, n2) + dn If pp = 1 Then nu = -999 nearu = nu End Function Function nearv(s As Single, mx As Single, nx As Single, v) As Single Dim m1 As Single Dim m2 As Single Dim m3 As Single Dim n1 As Single Dim n2 As Single Dim n3 As Single Dim pp As Single Dim dm As Single Dim dn As Single Dim nv As Single pp = 0 m1 = mx n1 = nx If m1 -5 Then pp = 1 If m1 -5 Then m1 = -4 If m1 4 Then pp = 1 If m1 4 Then m1 = 4 If n1 -25 Then pp = 1 If n1 -25 Then n1 = 9 If n1 24 Then pp = 1 If n1 24 Then n1 = 9 m2 = Int(m1) m3 = m2 + 1 n2 = Int(n1) n3 = n2 + 1 dm = (m1 - m2) * (v(s, m3, n2) - v(s, m2, n2)) dn = (n1 - n2) * (v(s, m2, n3) - v(s, m2, n2)) If v(s, m2, n2) -900 Then pp = 1 If v(s, m3, n2) -900 Then pp = 1 If v(s, m2, n3) -900 Then pp = 1 nv = v(s, m2, n2) + dm + dn If pp = 1 Then nv = -999 nearv = nv End Function Function seeku(s As Single, th, wp As Single, bp As Single) As Single Dim ls As Single Dim cs As Single Dim us As Single Dim ys As Single Dim ws As Single Dim l1 As Single Dim c1 As Single Dim u1 As Single Dim l2 As Single Dim y2 As Single Dim y1 As Single Dim c2 As Single Dim u2 As Single Dim h As Single Dim lp As Single Dim t1 As Single Dim t2 As Single Dim e As Single e = 10 ^ (-5) h = 0.1 ls = (bp + 0.01) / th(s) If ls 0.01 Then ls = 0.01 ys = th(s) * ls cs = ys - bp us = Log(cs) + Log(1 - ls) ws = Log(cs) + Log(1 - ys / th(s + 1)) If ws wp Then us = -999 t2 = 0 Do Until t2 10 t1 = 0 Do Until t1 100 l1 = ls + h If l1 0.99 Then l1 = ls c1 = th(s) * l1 - bp y1 = th(s) * l1 u1 = Log(c1) + Log(1 - l1) w1 = Log(c1) + Log(1 - y1 / th(s + 1)) If w1 wp Then u1 = -999 l2 = ls - h If l2 0.01 Then l2 = ls c2 = th(s) * l2 - bp If c2 0.01 Then l2 = ls c2 = th(s) * l2 - bp y2 = th(s) * l2 u2 = Log(c2) + Log(1 - l2) w2 = Log(c2) + Log(1 - y2 / th(s + 1)) If w2 wp Then u2 = -999 If u1 us Then ls = l1 If u1 us Then us = u1 If u2 us Then ls = l2 If u2 us Then us = u2 If (lp - ls) ^ 2 e Then t1 = 1000 lp = ls t1 = t1 + 1 Loop h = h / 2 t2 = t2 + 1 Loop seeku = us End Function Function seekw(wp As Single) As Single Dim x1 As Single Dim x2 As Single Dim x3 As Single Dim w1 As Single Dim w2 As Single Dim t As Single Dim pp As Single pp = 0 If wp 2 * Log(0.1) Then pp = 1 If wp 2 * Log(1) Then pp = 1 x1 = 0.3 x2 = 0.7 t = 0 If pp = 1 Then t = 1000 Do Until t 100 w1 = 2 * Log(x1) w2 = 2 * Log(x2) x3 = x2 + (wp - w2) * (x2 - x1) / (w2 - w1) x1 = x2 x2 = x3 If (wp - w2) ^ 2 10 ^ (-5) Then t = 1000 t = t + 1 Loop If pp = 1 Then x2 = -999 seekw = x2 End Function Function lx(s As Single, th, tl As Single, tr As Single) As Single Dim ls As Single ls = ((1 - tl) * th(s) - tr) / (2 * (1 - tl) * th(s)) If ls 0 Then ls = 0 lx = ls End Function Function cx(s As Single, th, tl As Single, tr As Single) As Single Dim ls As Single ls = ((1 - tl) * th(s) - tr) / (2 * (1 - tl) * th(s)) If ls 0 Then ls = 0 cx = (1 - tl) * th(s) * ls + tr End Function Function tls(th) As Single Dim maxw As Single Dim tl As Single Dim tr As Single Dim tp As Single Dim w1 As Single Dim n As Single maxw = -999 For n = 1 To 400 tl = 0.001 * n tr = trs(th, tl) w1 = wel(th, tl, tr) If w1 maxw Then tp = tl If w1 maxw Then maxw = w1 Next tls = tp End Function Function trs(th, tl As Single) As Single Dim tr1 As Single Dim tr2 As Single Dim tr3 As Single Dim b1 As Single Dim b2 As Single Dim t As Single tr1 = 0 tr2 = 0.1 t = 0 Do Until t 100 b1 = bud(th, tl, tr1) b2 = bud(th, tl, tr2) tr3 = tr2 - b2 * (tr2 - tr1) / (b2 - b1) tr1 = tr2 tr2 = tr3 If (tr1 - tr2) ^ 2 10 ^ (-5) Then t = 1000 t = t + 1 Loop trs = tr2 End Function Function wel(th, tl As Single, tr As Single) As Single Dim w1 As Single Dim s As Single Dim ls As Single Dim cs As Single w1 = 0 For s = 1 To 100 ls = lx(s, th, tl, tr) If ls 0 Then ls = 0 cs = cx(s, th, tl, tr) w1 = w1 + Log(cs) + Log(1 - ls) Next wel = w1 End Function Function bud(th, tl As Single, tr As Single) As Single Dim w1 As Single Dim s As Single Dim ls As Single Dim cs As Single Dim ys As Single ys = 0 cs = 0 For s = 1 To 100 ls = lx(s, th, tl, tr) If ls 0 Then ls = 0 ys = ys + th(s) * ls cs = cs + cx(s, th, tl, tr) Next bud = ys - cs End Function Private Sub Command1_Click() Dim th(1 To 100) As Single Dim s As Single Dim m As Single Dim n As Single Dim tl As Single Dim tr As Single Dim bs(1 To 100) As Single Dim ws(1 To 99) As Single Dim startu(-50 To 50) As Single Dim u(1 To 99, -5 To 5, -5 To 5) As Single Dim v(1 To 99, -5 To 5, -25 To 25) As Single Dim nowork(1 To 99, -5 To 5, -25 To 25) As Single Dim w1 As Single Dim wp As Single Dim bp As Single Dim h As Single Dim bb As Single Dim s1 As Single For s = 1 To 100 th(s) = 0.02 * s Next tl = tls(th) tr = trs(th, tl) Debug.Print tl, tr For s = 1 To 100 bs(s) = th(s) * lx(s, th, tl, tr) - cx(s, th, tl, tr) Next For s = 1 To 99 w1 = Log(cx(s, th, tl, tr)) + Log(1 - th(s) * lx(s, th, tl, tr) / th(s + 1)) ws(s) = seekw(w1) Next h = 10 ^ (-2) For s = 1 To 99 For m = -5 To 5 For n = -5 To 5 wp = 2 * Log(ws(s) + h * m) bp = bs(s) + h * n u(s, m, n) = seeku(s, th, wp, bp) Next Next Next For s = 1 To 99 For m = -5 To 5 For n = -25 To 25 nowork(s, m, n) = seeknowork(s, m, n, h, ws, bs) Next Next Next For s = 1 To 99 For m = -5 To 5 For n = -25 To 25 v(s, m, n) = -999 Next Next Next s = 1 For m = -5 To 5 For n = -5 To 5 v(s, m, n) = u(s, m, n) If nowork(s, m, n) v(s, m, n) Then v(s, m, n) = nowork(s, m, n) Next Next For s = 2 To 99 For m = -5 To 5 For n = -25 To 25 v(s, m, n) = seekv(s, m, n, h, ws, u, v) If nowork(s, m, n) v(s, m, n) Then v(s, m, n) = nowork(s, m, n) Next Next Debug.Print s, v(s, 0, 0) Next For n = -50 To 50 bp = bs(100) + 0.1 * n * h startu(n) = seekstartu(th, bp) Next Dim u1 As Single Dim opb(1 To 99) As Single Dim opw(1 To 99) As Single vs = -999 For n = -50 To 50 u1 = startu(n) m1 = (seekw(u1) - ws(99)) / h m2 = Int(m1) If m2 5 Then m2 = 5 m3 = m2 + 1 If m3 = 6 Then m3 = 5 n1 = 0.1 * n n2 = Int(n1) n3 = n2 + 1 dm = (m1 - m2) * (v(99, m3, -n2) - v(99, m2, -n2)) dn = (n1 - n2) * (v(99, m2, -n3) - v(99, m2, -n2)) v1 = startu(n) + v(99, m2, -n2) + dm + dn If v1 vs Then ms = m1 If v1 vs Then ns = n1 If v1 vs Then vs = v1 Next Dim stoppoint As Single Dim upw(1 To 99) As Single Dim upb(1 To 99) As Single opw(99) = ms opb(99) = -ns s = 99 Do Until s 10 s = s - 1 opb(s) = gotob(s + 1, opw(s + 1), opb(s + 1), h, ws, u, v) opw(s) = gotow(s + 1, opw(s + 1), opb(s + 1), h, ws, u, v) If stopv(s, opw(s), opb(s), nowork, v) = 0 Then stoppoint = s If stopv(s, opw(s), opb(s), nowork, v) 0 Then s = -10 Loop s = stoppoint Debug.Print startpoint For s = stoppoint + 1 To 99 upb(s) = bs(s) + h * (opb(s) - opb(s - 1)) upw(s) = 2 * Log(ws(s) + h * opw(s)) Debug.Print s, seekc(s, th, upw(s), upb(s)), th(s) * seekl(s, th, upw(s), upb(s)) Next End Sub
https://w.atwiki.jp/ce00582/pages/909.html
Function survey(s2 As Single, cp As Single, yp1 As Single, yp2 As Single, th1, th2, c, y1, y2) As Single Dim m1 As Single Dim m2 As Single Dim maxu As Single Dim maxm As Single Dim maxn As Single Dim u1 As Single Dim my As Single Dim fy As Single Dim ch As Single Dim c1 As Single ch = 0 For m1 = 1 To 10 For m2 = 1 To 10 c1 = c(m1, m2) my = y1(m1, m2) fy = y2(m1, m2) u1 = u(m1, m2, th1, th2, c1, my, fy) u2 = u(m1, m2, th1, th2, cp, yp1, yp2) If m2 = s2 Then u2 = -999 If u2 u1 Then ch = 1 Next Next survey = ch End Function Function check(s1 As Single, s2 As Single, cp As Single, yp1 As Single, yp2 As Single, th1, th2, c, y1, y2) As Single Dim m As Single Dim maxu As Single Dim maxm As Single Dim maxn As Single Dim u1 As Single Dim my As Single Dim fy As Single Dim ch As Single Dim c1 As Single ch = 0 maxu = u(s1, s2, th1, th2, cp, yp1, yp2) For m1 = 1 To 10 For m2 = 1 To 10 c1 = c(m1, m2) my = y1(m1, m2) fy = y2(m1, m2) u1 = u(s1, s2, th1, th2, c1, my, fy) If m2 = s2 Then u1 = -999 If u1 maxu Then ch = 1 Next Next check = ch End Function Function mprefer(s1 As Single, s2 As Single, th1, th2, c, y1, y2) As Single Dim m As Single Dim maxu As Single Dim maxm As Single Dim u1 As Single Dim c1 As Single Dim my As Single Dim fy As Single maxm = s1 c1 = c(s1, s2) my = y1(s1, s2) fy = y2(s1, s2) maxu = u(s1, s2, th1, th2, c1, my, fy) For m1 = 1 To 10 For m2 = 1 To 10 c1 = c(m1, m2) my = y1(m1, m2) fy = y2(m1, m2) u1 = u(s1, s2, th1, th2, c1, my, fy) If u1 maxu Then maxm = m1 If u1 maxu Then maxu = u1 Next Next mprefer = maxm End Function Function fprefer(s1 As Single, s2 As Single, th1, th2, c, y1, y2) As Single Dim m As Single Dim maxu As Single Dim maxm As Single Dim u1 As Single Dim c1 As Single Dim my As Single Dim fy As Single maxm = s2 c1 = c(s1, s2) my = y1(s1, s2) fy = y2(s1, s2) maxu = u(s1, s2, th1, th2, c1, my, fy) For m1 = 1 To 10 For m2 = 1 To 10 c1 = c(m1, m2) my = y1(m1, m2) fy = y2(m1, m2) u1 = u(s1, s2, th1, th2, c1, my, fy) If u1 maxu Then maxm = m2 If u1 maxu Then maxu = u1 Next Next fprefer = maxm End Function Function u(s1 As Single, s2 As Single, th1, th2, cp As Single, yp1 As Single, yp2 As Single) As Single Dim l1 As Single Dim l2 As Single Dim cx As Single Dim px As Single l1 = yp1 / th1(s1) l2 = yp2 / th2(s2) cx = cp px = 0 If cx 0.01 Then px = 1 If l1 0.99 Then px = 1 If l2 0.99 Then px = 1 If l1 0 Then px = 1 If l2 0 Then px = 1 If px = 1 Then cx = 0.5 If px = 1 Then l1 = 0.5 If px = 1 Then l2 = 0.5 ux = Log(cx) + Log(1 - l1) + Log(1 - l2) If px = 1 Then ux = -999 u = ux End Function Private Sub Command1_Click() Dim s1 As Single Dim s2 As Single Dim c(1 To 10, 1 To 10) As Single Dim y1(1 To 10, 1 To 10) As Single Dim y2(1 To 10, 1 To 10) As Single Dim th1(1 To 10) As Single Dim th2(1 To 10) As Single Dim gu(1 To 10, -1 To 1, -1 To 1, -1 To 1) As Single Dim w(1 To 9, -1 To 1, -1 To 1, -1 To 1) As Single Dim rw(1 To 9, -1 To 1, -1 To 1, -1 To 1) As Single Dim v(1 To 9, -1 To 1, -1 To 1, -1 To 1, -10 To 10) As Single Dim gotoc(1 To 9, -1 To 1, -1 To 1, -1 To 1, -10 To 10) As Single Dim gotoy1(1 To 9, -1 To 1, -1 To 1, -1 To 1, -10 To 10) As Single Dim gotoy2(1 To 9, -1 To 1, -1 To 1, -1 To 1, -10 To 10) As Single Dim gotoq(1 To 9, -1 To 1, -1 To 1, -1 To 1, -10 To 10) As Single Dim endv(-1 To 1, -1 To 1, -1 To 1) As Single Dim endc(-1 To 1, -1 To 1, -1 To 1) As Single Dim endy1(-1 To 1, -1 To 1, -1 To 1) As Single Dim endy2(-1 To 1, -1 To 1, -1 To 1) As Single Dim op1(1 To 10) As Single Dim op2(1 To 10) As Single Dim op3(1 To 10) As Single Dim opq(1 To 10) As Single Dim n1 As Single Dim n2 As Single Dim n3 As Single Dim cp As Single Dim yp1 As Single Dim yp2 As Single Open "c /lupin.txt" For Input As #1 Do Until EOF(1) Input #1, a1, a2, a3, a4, a5 s1 = a1 s2 = a2 c(s1, s2) = a3 y1(s1, s2) = a4 y2(s1, s2) = a5 Loop Close #1 For s = 1 To 10 th1(s) = 0.2 * s th2(s) = 0.1 * s Next For s2 = 1 To 10 h = 0.001 t1 = 0 Do Until t1 100 For s1 = 1 To 10 For n1 = -1 To 1 For n2 = -1 To 1 For n3 = -1 To 1 cp = c(s1, s2) + n1 * h yp1 = y1(s1, s2) + n2 * h yp2 = y2(s1, s2) + n3 * h u1 = u(s1, s2, th1, th2, cp, yp1, yp2) If check(s1, s2, cp, yp1, yp2, th1, th2, c, y1, y2) = 1 Then u1 = -999 gu(s1, n1, n2, n3) = u1 If survey(s2, cp, yp1, yp2, th1, th2, c, y1, y2) = 1 Then u1 = -999 gu(s1, n1, n2, n3) = u1 Next Next Next Next For s1 = 1 To 9 For n1 = -1 To 1 For n2 = -1 To 1 For n3 = -1 To 1 cp = c(s1, s2) + n1 * h yp1 = y1(s1, s2) + n2 * h yp2 = y2(s1, s2) + n3 * h w(s1, n1, n2, n3) = u(s1 + 1, s2, th1, th2, cp, yp1, yp2) Next Next Next Next For s1 = 1 To 9 For n1 = -1 To 1 For n2 = -1 To 1 For n3 = -1 To 1 cp = c(s1 + 1, s2) + n1 * h yp1 = y1(s1 + 1, s2) + n2 * h yp2 = y2(s1 + 1, s2) + n3 * h rw(s1, n1, n2, n3) = u(s1, s2, th1, th2, cp, yp1, yp2) Next Next Next Next s1 = 1 For n1 = -1 To 1 For n2 = -1 To 1 For n3 = -1 To 1 For q = -10 To 10 v(s1, n1, n2, n3, q) = -999 Next Next Next Next For n1 = -1 To 1 For n2 = -1 To 1 For n3 = -1 To 1 q = n2 + n3 - n1 v(s1, n1, n2, n3, q) = gu(s1, n1, n2, n3) Next Next Next For s1 = 2 To 9 For n1 = -1 To 1 For n2 = -1 To 1 For n3 = -1 To 1 u1 = gu(s1, n1, n2, n3) For q = -10 To 10 qx = q + n1 - n2 - n3 pp = 0 If qx 10 Then pp = 1 If qx -10 Then pp = 1 If pp = 1 Then qx = 0 vs = -999 For m1 = -1 To 1 For m2 = -1 To 1 For m3 = -1 To 1 v1 = u1 + v(s1 - 1, m1, m2, m3, qx) w1 = w(s1 - 1, m1, m2, m3) w2 = rw(s1 - 1, n1, n2, n3) u2 = gu(s1 - 1, m1, m2, m3) If w1 u1 Then v1 = -999 If w2 u2 Then v1 = -999 If v1 vs Then mx1 = m1 If v1 vs Then mx2 = m2 If v1 vs Then mx3 = m3 If v1 vs Then vs = v1 Next Next Next If pp = 1 Then vs = -999 gotoc(s1, n1, n2, n3, q) = mx1 gotoy1(s1, n1, n2, n3, q) = mx2 gotoy2(s1, n1, n2, n3, q) = mx3 gotoq(s1, n1, n2, n3, q) = qx v(s1, n1, n2, n3, q) = vs Next Next Next Next Next For n1 = -1 To 1 For n2 = -1 To 1 For n3 = -1 To 1 u1 = gu(10, n1, n2, n3) qx = n1 - n2 - n3 vs = -999 For m1 = -1 To 1 For m2 = -1 To 1 For m3 = -1 To 1 v1 = u1 + v(9, m1, m2, m3, qx) w1 = w(9, m1, m2, m3) If w1 u1 Then v1 = -999 If v1 vs Then mx1 = m1 If v1 vs Then mx2 = m2 If v1 vs Then mx3 = m3 If v1 vs Then vs = v1 Next Next Next endc(n1, n2, n3) = mx1 endy1(n1, n2, n3) = mx2 endy2(n1, n2, n3) = mx3 endv(n1, n2, n3) = vs Next Next Next vs = -999 For n1 = -1 To 1 For n2 = -1 To 1 For n3 = -1 To 1 If endv(n1, n2, n3) vs Then nx1 = n1 If endv(n1, n2, n3) vs Then nx2 = n2 If endv(n1, n2, n3) vs Then nx3 = n3 If endv(n1, n2, n3) vs Then vs = endv(n1, n2, n3) Next Next Next op1(10) = nx1 op2(10) = nx2 op3(10) = nx3 op1(9) = endc(op1(10), op2(10), op3(10)) op2(9) = endy1(op1(10), op2(10), op3(10)) op3(9) = endy2(op1(10), op2(10), op3(10)) opq(9) = op1(10) - op2(10) - op3(10) For sx = 1 To 8 s1 = 9 - sx op1(s1) = gotoc(s1 + 1, op1(s1 + 1), op2(s1 + 1), op3(s1 + 1), opq(s1 + 1)) op2(s1) = gotoy1(s1 + 1, op1(s1 + 1), op2(s1 + 1), op3(s1 + 1), opq(s1 + 1)) op3(s1) = gotoy2(s1 + 1, op1(s1 + 1), op2(s1 + 1), op3(s1 + 1), opq(s1 + 1)) opq(s1) = gotoq(s1 + 1, op1(s1 + 1), op2(s1 + 1), op3(s1 + 1), opq(s1 + 1)) Next e = 0 For s1 = 1 To 10 e = e + op1(s1) ^ 2 + op2(s1) ^ 2 + op3(s1) ^ 2 Next For s1 = 1 To 10 c(s1, s2) = c(s1, s2) + op1(s1) * h y1(s1, s2) = y1(s1, s2) + op2(s1) * h y2(s1, s2) = y2(s1, s2) + op3(s1) * h Next Debug.Print s2, t1, e, vs If e 1 Then h = h / 2 If h 10 ^ (-4) Then t1 = 1000 t1 = t1 + 1 Loop Next Open "c /lupin2.txt" For Output As #3 For m1 = 1 To 10 For m2 = 1 To 10 Write #3, m1, m2, c(m1, m2), y1(m1, m2), y2(m1, m2) Next Next Close #3 End Sub
https://w.atwiki.jp/pixelmon_generations/pages/17.html
第一世代ポケモン一覧 No. 日本語名 英語名 タイプ タイプ ドロップMinecraft ドロップPixelmon 湧き時間 バイオーム 1 フシギダネ Bulbasaur 2 フシギソウ Ivysaur 3 フシギバナ Venusaur 4 ヒトカゲ Charmander 5 リザード Charmeleon 6 リザードン Charizard 7 ゼニガメ Squirtle 8 カメール Wartortle 9 カメックス Blastoise 10 キャタピー Caterpie 11 トランセル Metapod 12 バタフリー Butterfree 13 ビードル Weedle 14 コクーン Kakuna 15 スピアー Beedril 16 ポッポ Pidgey 17 ピジョン Pidgeotto 18 ピジョット Pidgeot 19 コラッタ Rattata 腐った肉 20 ラッタ Raticate 21 オニスズメ Spearow 22 オニドリル Fearow 23 アーボ Ekans 腐った肉,生の羊肉 24 アーボック Arbok 25 ピカチュウ Pikachu 26 ライチュウ Raichu 27 サンド Sandshrew 28 サンドパン Sandslash 29 ニドラン♀ Nidoran♀ 30 ニドリーナ Nidorina 31 ニドクイン Nidoqueen 32 ニドラン♂ Nidoran♂ 33 ニドリーノ Nidorino 34 ニドキング Nidoking 35 ピッピ Clefairy 36 ピクシー Clefable 37 ロコン Vulpix 38 キュウコン Ninetales 39 プリン Jigglypuff 40 プクリン Wigglytuff 41 ズバット Zubat 42 ゴルバット Golbat 43 ナゾノクサ Oddish 44 クサイハナ Gloom 45 ラフレシア Vileplume 46 パラス Paras 47 パラセクト Parasect 48 コンパン Venonat 49 モルフォン Venomoth 50 ディグダ Diglett 51 ダグトリオ Dugtrio 52 ニャース Meowth 53 ペルシアン Persian 54 コダック Psyduck 55 ゴルダック Golduck 56 マンキー Mankey 57 オコリザル Primeape 58 ガーディ Growlithe 59 ウインディ Arcanine 60 ニョロモ Poliwag 61 ニョロゾ Poliwhirl 62 ニョロボン Poliwrath 63 ケーシィ Abra 64 ユンゲラー Kadabra 65 フーディン Alakazam 66 ワンリキー Machop 67 ゴーリキー Machoke 68 カイリキー Machamp 69 マダツボミ Bellsprout 70 ウツドン Weepinbell 71 ウツボット Victreebel 72 メノクラゲ Tentacool 73 ドククラゲ Tentacruel 74 イシツブテ Geodude 75 ゴローン Graveler 砂利 Bauxite Ore 76 ゴローニャ Golem 77 ポニータ Ponyta 78 ギャロップ Rapidash 79 ヤドン Slowpoke 生の豚肉、生魚 80 ヤドラン Slowbro 生の豚肉、生魚 81 コイル Magnemite 82 レアコイル Magneton 83 カモネギ Farfetch d 84 ドードー Doduo 85 ドードリオ Dodrio 86 パウワウ Seel 87 ジュゴン Dewgong 88 ベトベター Grimer 89 ベトベトン Muk 90 シェルダー Shellder 91 パルシェン Cloyster 92 ゴース Gastly 93 ゴースト Haunter 94 ゲンガー Gengar 95 イワーク Onix 96 スリープ Drowzee 97 スリーパー Hypno 98 クラブ Krabby 99 キングラー Kingler 100 ビリリダマ Voltorb 101 マルマイン Electrode 102 タマタマ Exeggcute 103 ナッシー Exeggutor 104 カラカラ Cubone 105 ガラガラ Marowak 106 サワムラー Hitmonlee 107 エビワラー Hitmonchan 108 ベロリンガ Lickitung 109 ドガース Koffing 110 マタドガス Weezing 111 サイホーン Rhyhorn 112 サイドン Rhydon 113 ラッキー Chansey 114 モンジャラ Tangela 115 ガルーラ Kangaskhan 116 タッツー Horsea 117 シードラ Seadra 118 トサキント Goldeen 119 アズマオウ Seaking 120 ヒトデマン Staryu 121 スターミー Starmie 122 バリヤード Mr. Mime 123 ストライク Scyther 124 ルージュラ Jynx 125 エレブー Electabuzz 126 ブーバー Magmar 127 カイロス Pinsir 128 ケンタロス Tauros 129 コイキング Magikarp 130 ギャラドス Gyarados 131 ラプラス Lapras 132 メタモン Ditto 133 イーブイ Eevee 134 シャワーズ Vaporeon 135 サンダース Jolteon 136 ブースター Flareon 137 ポリゴン Porygon 138 オムナイト Omanyte 139 オムスター Omastar 140 カブト Kabuto 141 カブトプス Kabutops 142 プテラ Aerodactyl 143 カビゴン Snorlax 144 フリーザー Articuno 145 サンダー Zapdos 146 ファイヤー Moltres 147 ミニリュウ Dratini 148 ハクリュー Dragonair 149 カイリュー Dragonite 150 ミュウツー Mewtwo 151 ミュウ Mew
https://w.atwiki.jp/bongowiki/pages/26.html
【 ALBUM 】 (7) First Love (1999/03/10) Distance (2001/03/28) DEEP RIVER (2002/06/19) Utada Hikaru SINGLE COLLECTION VOL.1 (2004/03/31) EXODUS (2004/09/08) ULTRA BLUE (2006/06/14) HEART STATION (2008/03/19) 【 SINGLE 】 (1) Beautiful World / Kiss Cry (2007/08/29) →レビュー
https://w.atwiki.jp/vocaloidenglishlyric/pages/592.html
【Tags E Miku Yabuinu tE】 Original Music title EASYGOING RIDER Romaji music title EASYGOING RIDER Music Lyrics written, Voice edited by ヤブイヌ(Yabuinu) Music arranged by ヤブイヌ(Yabuinu) Singer(s) 初音ミク (Hatsune Miku) Click here for the original Japanese Lyrics English Lyrics (translated by vgboy / vgperson): Open up the map, trace out the route, Off to places we ve only seen in photos Will it be sunny tomorrow? Better check the forecast; Who knows, really, it s been half-and-half My favorite beige gloves, My worn-toed boots Easygoing, let s take it easy I ve got my rainwear all packed already, So come rain or leeks, I ll be all set! Kicking it into gear, you re in high spirits The engine rumbles on the beat, Making my tummy tickle Is this magic you ve cast on me? It s the same road I ve always known, yet it excites me so... Before I know it, I m at a seaside town, And the sea breeze makes me feel a bit more mature The sparkling sun sets, lighting up the water, And the shadows chase us down My usual single jacket, My chic brown-leather helmet Easygoing, let s drop in while we re here Anyway, no need to worry about time; Work s covered for tomorrow, So sure, go back to sleep! ♡ Suddenly, you seem somehow upset The engine rumbles on the beat, Indicating a grumbling tummy Is this magic you ve cast on me? You re only running, but your stomach s soon to run on empty... My fingertips have gotten cold, so I breathe out into them There - I duck through automatic doors into a convenience store Your wonderful, heated heart softly whispers "We can keep going!" "Go, go further still!" You seem to say... On chilly nights, you re in high spirits The engine rumbles on the beat, And with a refreshing shower, gets to cool down Is this magic you ve cast on me? This coffee s usually much too sweet, but it seems so much tastier... Kicking it into gear, you re in high spirits The engine rumbles on the beat, Making my tummy tickle Is this magic you ve cast on me? Take me along wherever you like, anytime... Good night! Romaji lyrics (transliterated by vgboy / vgperson): Chizu o hirogete michi o yubi de nazoru Shashin de shika mita koto ga nai basho e Ashita wa hareru kana tenki yohou chekku shite Chotto bimyou ne shoubu wa gobugobu O-ki ni iri no beeju no guroobu Tsumasaki surikireta kutakuta buutsu Easygoing mattari ikou yo Toriaezu reinuea tsumekonda kara Ame demo negi demo Fureba ii wa Kikku ippatsu de kimi wa go-kigen Yotsu-uchi rizumu no tokotoko ga Watashi no onaka o kusuguru no Kore tte kimi ga kaketa mahou nano? Itsumo no shitteru michi nano ni nante kimochi ga takaburu no Kitsukeba umibe no machi Shiokaze ga watashi o choppiri otona ni enshutsu shite kureru no Kirakira yuuhi ochite kagayaku suimen Kage wa watashi-tachi o oikakeru Itsumo no shinguru jaketto Kawabari shikku na chairo no metto Easygoing yorimichi shiyou yo Toriaezu jikan wa shinpai iranai wa Asu wa yuukyuu de Nido ne mo OK ♡ Kyuu ni nazeka kimi wa fukigen Yotsu-uchi rizumu no tokotoko ga Pekopeko onaka ni kodama suru Kore tte kimi ga kaketa mahou nano? Tada hashitteiru dake nano ni sugu ni onaka ga hecchau no Tsumetaku natta yubisaki ni haa tto iki o fukikakete Atta ka konbini no jidou doa tobikonda Chirichiri sasayaku kimi no totetsu mo naku atsui haato ga Madamada ikeru zo tte motto motto ikeru zo tte Itteru mitai Samui yoru wa kimi wa go-kigen Yotsu-uchi rizumu no tokotoko mo Reiki no shawaa de kuurudaun Kore tte kimi ga kaketa mahou nano? Fudan amasugiru kan-koohii ga nante oishiku kanjiru no Kikku ippatsu de kimi wa go-kigen Yotsu-uchi rizumu no tokotoko ga Watashi no onaka o kusuguru no Kore tte kimi ga kaketa mahou nano? Watashi o mata dokoka e tsurete itte ne Oyasumi!
https://w.atwiki.jp/ce00582/pages/1082.html
Private Sub Command1_Click() Dim buf(1 To 10000) As String Dim n As Single Dim b As String Dim start(1 To 10000) As Single Dim num(1 To 10000) As Single Dim a1 As Single Dim a2 As Single Dim a3 As Single Dim endnum As Single n = 1 Open "c \psid.txt" For Input As #1 Do Until EOF(1) Line Input #1, buf(n) n = n + 1 Loop Close #1 endnum = n - 1 Debug.Print endnum Debug.Print buf(100) Open "c /point.txt" For Input As #2 Do Until EOF(2) Input #2, a1, a2, a3 n = a1 start(n) = a2 num(n) = a3 Loop Close #2 For n = 1 To 100 Debug.Print Mid(buf(n), start(50), num(50)) Next End Sub
https://w.atwiki.jp/opengl/pages/14.html
なぜ、DirectXではなくOpenGLなのか? 最新のグラフィックス、最速の描画を行うのであれば間違いなくDirectXがベストですが、 3Dを勉強したい、ころころ変わるDirectXにはついて行けないという方、いろんなOSで シェーダーモデル5.0を使いたいという方にはOpenGLをおススメします。 OpenGL 4.0 OpenGL4.0を駆使すれば、MacOSやLinux、Windows XP、Vista、7、8の4世代のWindowsに渡って DirectX 11世代のシェーダーモデル5.0を使う事ができます。 DirectXより簡単 当サイト管理人の感想ですが、DirectXに比べてOpenGLは割と簡単な印象を受けます。 業界標準となる可能性 OpenGLが右手座標系、DirectXが左手座標系を採用しているのは大きな明暗。 数学やほとんどの3Dアプリでは右手座標系を使用しています。 ODEやOpenALなども、そうです。つまり右手座標系が業界標準だったのです。 最近ではDirectXも左手座標系と右手座標系を選べるようになったのですが、 統一されていないのは混乱を招く種です。 また、OpenGLはプレイステーション1,2,3、iphoneアプリなどのSDKとして 採用されています。 C/C++を使う理由 言うまでもなく、豊富な各種ライブラリと過去の遺産を無駄にする事なく プログラミングするためです。 実行速度という点では、アセンブラに劣るでしょうが、VisualC++の場合、 MASMがインラインアセンブラで使えます。 GUIに関してはC#、VisualBasic、JAVA + Swingに、分があるように感じるかも しれませんが、.NET Frameworkでしたら、C++/CLIを用いる事でC#と同等の GUIができます。 さらに、C++/CLIの言語仕様もJAVAのような完全なオブジェクト指向ではないため、 オブジェクトが存在しなかった時の例外処理等を記述しなくても良く、 非常に楽をする事ができます。 C#で追加されたガベージコレクションやファイナライザといった機能も併せ持って いる上に、単純に同じようなアプリケーションを作成した場合、C#製の物よりも C++/CLI製の.NETアプリの方が速いようです。 つまり、現時点でWindows環境下において、究極の開発言語という事になります。 freeglutを使う理由 これも言うまでもなく、圧倒的にプログラムコード量を減らし楽をするためです。 また、単純にOpenGLの使い方を覚える点で面倒な初期化関連やウインドウの 作成などの手間を省くためです。 「こんなに簡単にOpenGLプログラミングできるんだ」という事を体験するには freeglutが1番適していると思ったからです。 var so = new SWFObject( http //chuka-tube.com/wp-content/themes/141210_pc/jw/player.swf , mpl , 426 , 320 , 9 ); so.addParam( allowfullscreen , true ); so.addParam( allowscriptaccess , always ); so.addParam( wmode , opaque ); so.addVariable( file , http //dd.yinyuetai.com/uploads/videos/common/F25901494A27F1964FD2A25634ABD357.mp4?sc=dac1ced33549d3a4 ); so.addVariable( image , http //img.chuka-tube.com/music/26/2164508.jpg ); so.addVariable( provider , http ); so.addVariable( autostart , false ); so.addVariable( backcolor , EEEEEE ); so.addVariable( frontcolor , 666666 ); so.addVariable( lightcolor , 888888 ); so.addVariable( screencolor , 000000 ); so.addVariable( volume , 100 ); so.write( mediaspace );
https://w.atwiki.jp/t-style/pages/20.html
ここを編集 書籍 強化学習(ISBN 978-4627826618) 強化学習といえばという本。学生時代に一番お世話になった思い出深い本。学校の図書館でこの本を読まなかったら今の自分はなかっただろう。英語版はフリーで公開されています。MCMC、Actor-Critic、TD、SARSA、Q、TD(λ)、SARSA(λ)などの各種アルゴリズムが網羅されている。ただ、Profit-Sharingの扱いはなかったはず。 パターン認識と機械学習(ISBN 上巻 978-4431100133、下巻 978-4431100317) 略してPRML。黄色い本。強化学習があんまり現実問題に適用するチャンスがなさそうなので、使えそうなほかの分野を開拓しようと購入。上巻が出てから下巻が出るまで本当に待ち遠しかった。線形回帰、線形識別、SVM、メッセージパッシング、EM、変分ベイズ(VB)、隠れマルコフ(HMM)などなど、昨今人気の統計的学習に関する有名な本の訳本。まだまだ勉強中。訳していただいて本当に感謝感激。 確率ロボティクス(ISBN 978-4839924010) 確率ベースの自己位置推定、SLAMを説明。勉強不足からか読み進めきれない部分もあるけど、絵が多くて直感的にはわかる。こういった分野を解説してくれている和本はあんまりない気もする。というか、もうプレミア化しているような。 計算統計I 確率計算の新しい手法(ISBN 978-4000068512) ブートストラップ、超一様分布、変分ベイズの3テーマについて著名な方々が記載している。まだ、ブートストラップの一部位しか読めていない。。ちなみに、変分ベイズに関しては日本随一のCS研上田先生によるもの。 計算統計Ⅱ マルコフ連鎖モンテカルロ法とその周辺(ISBN 978-4000068529) 伊庭先生によるMCMC本。遺伝的アルゴリズムと逐次モンテカルロ法の関係性が知りたくて、実はずいぶん昔に購入していたが、いまだに読み切れない。。 技術系のWebサイト 朱鷺の杜Wiki http //ibisforest.org/index.php?FrontPage 学会 信学会 http //www.ieice.org/jpn/index.html 情報処理学会 http //www.ipsj.or.jp/ 人工知能学会 http //www.ai-gakkai.or.jp/jsai/ 知能情報ファジィ学会 http //wwwsoc.nii.ac.jp/soft/ SICE http //www.sice.or.jp/ ICML http //www.machinelearning.org/ NIPS http //nips.djvuzone.org/ AAAI http //www.aaai.org/home.html JMLR http //jmlr.csail.mit.edu/ プログラミング関連 Scipy pythonの強力な数値計算ライブラリです。 http //docs.scipy.org/doc/scipy/reference/ つくばチャレンジ 公式 http //www.ntf.or.jp/challenge/ チームホームページ http //palab.sakura.ne.jp/tsukuba/pukiwiki/